# $Id: PKGBUILD 84936 2013-02-26 10:20:29Z spupykin $
# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jason Chu <jason@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=xboard
pkgver=4.7.0
pkgrel=1
pkgdesc="Graphical user interfaces for chess"
arch=('i686' 'x86_64')
url="http://www.gnu.org/software/xboard/"
license=('GPL3')
depends=('gnuchess' 'texinfo' 'xdg-utils'
	 'xorg-fonts-75dpi' 'xorg-fonts-100dpi'
	 'gtk2' 'cairo' 'librsvg')
makedepends=('gendesk')
optdepends=('perl')
install=${pkgname}.install
source=("http://ftp.gnu.org/gnu/${pkgname}/${pkgname}-${pkgver}.tar.gz")
md5sums=('646e5091f7ee4b5fa9998d2cca9cf795')

build() {
  cd "${srcdir}"
  gendesk

  cd "${pkgname}-${pkgver}"
  sed -i 's/fairymax/gnuchess/g' {xaw,gtk}/xboard.h xboard.conf.in
  ./configure \
    --prefix=/usr \
    --mandir=/usr/share/man \
    --sysconfdir=/etc \
    --with-gtk
  make
}

package() {
  cd "${srcdir}/${pkgname}-${pkgver}"

  make DESTDIR="${pkgdir}" install
  install -Dm644 ${srcdir}/${pkgname}.desktop \
    ${pkgdir}/usr/share/applications/${pkgname}.desktop
  install -Dm644 ${srcdir}/${pkgname}.png \
    ${pkgdir}/usr/share/pixmaps/${pkgname}.png
  install -Dm755 ${srcdir}/${pkgname}-${pkgver}/cmail \
    ${pkgdir}/usr/bin/cmail
}
